package dp.sgd;

/**
 * Zaznam predstavuje dvojicu kategoria - text
 * @author Michal Immer
 *
 */
public class Record {
	
	public Record() {
		
	}
	
	/*
	 * konstruktor zaznamu s parametrom line - co je jeden riadok (surovy zaznam) z datasetu
	 */
	public Record(String line) {
		if (line.contains("	")) {
			this.category = line.substring(0, line.indexOf("	")).trim();
			this.text = line.substring(line.indexOf("	")).trim(); 
		}
		else if (line.contains(" ")){
			this.category = line.substring(0, line.indexOf(" ")).trim();
			this.text = line.substring(line.indexOf(" ")).trim(); 
		}
	}
	
	private String category;
	private String text;
	
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
}
